<?php
/**
 * @author Minh Luan
 * @copyright 2012
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Đăng tin tuyển dụng</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style media="all" type="text/css">
@import "../css/all.css";
</style>
</head>
<body>
<div id="main">

    <?php
        $page = 3;
        include "../admin/header.php";  
        include "../service/userService.php";
        include "../service/recruitmentsService.php";
    ?>  
  <div id="middle">
    <div id="left-column">
      <h3>Chức năng</h3>
      <ul class="nav">
        <?php
        //Company function
        if($loggedInUser[2] == 3){
            echo "<a href='../pc/recruitments.php'>Đăng tin tuyển dụng</a>";
        }
        ?>
      </ul>
       
      </div>
    <div id="center-column">        
      <div class="top-bar">
        <a href="../pc/recruitmentDetail.php" class="button">Thêm</a>
        <h1>Quản lí tin tuyển dụng</h1>
      </div>
      <br />
      <?php
        $infor = null;
        $infor = mysql_fetch_array(getCompanyInfor($loggedInUser[1]));
        $recruitments = getAllRecruitmentOfCompany($loggedInUser[0]);
      ?>
      <div class="table"><img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
      <table class="listing form" cellpadding="0" cellspacing="0">
        <th>Danh sách tin đã đăng</th>
        <?php
            while($recruitment = mysql_fetch_array($recruitments)){
        ?>
            <tr>
                <td><a href="recruitmentDetail.php?n=<?php echo $recruitment["RECRUITMENT_ID"]; ?>"><?php echo $recruitment["RECRUITMENT_NAME"]; ?></a></td>
            </tr>
        <?php
            }
        ?>
      </table>
      </div>
    </div>
    <div id="right-column"> <strong class="h">Ghi chú</strong>
      <div class="box">Quản lí những tin tuyển dụng đã đăng và chỉnh sửa hoặc thêm tin mới</div>
    </div>
  </div>
  <?php include "../admin/footer.php";?>
</div>
</body>
</html>